package com.zhl.map_traverse5;

import java.util.HashMap;
import java.util.Map;
import java.util.Set;

public class MapTest1 {
    public static void main(String[] args) {
        //准备一个Map集合
        Map<String, Double> map = new HashMap<>();
        map.put("蜘蛛精",178.5 );
        map.put("至尊宝",189.5 );
        map.put("白骨精",168.5 );
        map.put("神仙姐姐",198.5 );
        map.put("红孩儿",158.5 );
        //遍历Map集合
        //1.获取集合的全部键
        Set<String> keys = map.keySet();
        System.out.println("全部键："+keys);
        //根据键获取对应的值
        for(String key : keys){
            System.out.println(key+"====>"+map.get(key));
        }

    }
}
